// 个性推荐相关 接口
import request from '../utils/request'
import { setCookie, getCookie } from '@/utils/cookie'
const cookie = getCookie('loginCookie')

export interface IBannerlist {
	imageUrl: string,
	encodeId: string
}
export interface IGetBannerList {
	banners: [IBannerlist],
	code: number
}
// 获取 轮播图 接口
export const getBannerApi = () => request.get<any, IGetBannerList>('/banner')

export interface IEverydayRecommendResource {
	readonly id: number,
	name: string,
	picUrl: string,
	coverImgUrl?: string,
	playcount: number,
	playCount?: number,
	trackCount: number,
	type: number
}
export interface IGetEverydayRecommendResource {
	code: number,
	featureFirst: Boolean,
	haveRcmdSongs: Boolean,
	recommend: IEverydayRecommendResource[]
}
// 获取 每日推荐歌单 接口
export const getEverydayRecommendResourceApi = () => request.get<any, IGetEverydayRecommendResource>(`/recommend/resource`)

// 获取 每日推荐歌曲 接口
export const getEverydayRecommendSongApi = () => request.get('/recommend/songs')

interface IGetFineResourceApi {
	code: number,
	lasttime: number,
	more: boolean,
	playlists: IEverydayRecommendResource[],
	total: number
}
// 获取 精品歌单推荐 接口
export const getFineResourceApi = () => request.get<any, IGetFineResourceApi>('/top/playlist/highquality?limit=10')
